<template>
	<div class="mainContent">
		<pathTracking :path="Model.path" />
		<div class="container">
			<el-row class="detailTable">
				<el-form :inline="true" v-show="Model.detailTableFrom.flag">
					<el-col :sm="24" :md="12" :lg="8" :xl="6" v-for="(item,index) in Model.tableFormInline" :key="index">
						<el-form-item :label="item.label+'：'">{{item.value}}</el-form-item>
					</el-col>
				</el-form>
			</el-row>
			<!-- **********************************************               出库详情                   ************************************** -->
			<div>
				<el-row class="detailTable">
					<div class="detailTableItemTitle">
						<img class="detailTableImgSmall" src="@/assets/img/flower_brown.png" alt="">
						<p class="text">采购单基础信息</p>
						<img class="detailTableImgNormal" :src="Model.tab1TableDetail1.src" alt="" @click="toggleTableDetail('tab1TableDetail1')">
						<!-- <img class="detailTableImgNormal" src="@/assets/img/icon_unfold.png" alt="" v-show="Model.tab1TableDetail1"> -->
					</div>
					<div class="detailTableDetail" v-show="Model.tab1TableDetail1.flag">
						<el-table :data="Model.tableData" border style="width: 100%;">
							<el-table-column 
								v-for="(item,index) in Model.tableHeaderData"
								:key="item.prop"
								:prop="item.prop" 
								:label="item.label" 
								:width="item.width" 
							></el-table-column>
						</el-table>
					</div>
				</el-row>
				<el-row class="bottom">
					<div class="btn_group">
						<div class="btn_item" @click="Model.Replacementthing = true">同意变更</div>
						<div class="btn_item cancel" @click="noChange">拒绝变更</div>
					</div>
				</el-row>
			</div>
		</div>
		<!-- 变更商品补发物料 -->
		<el-dialog title :visible.sync="Model.Replacementthing" class="Replacementthing">
			<div class="common-table-title">
				<div class="common-table-icon"></div>
				<div class="common-table-fl">提示</div>
			</div>
			<el-form ref="form" class="ReplacementCort">
				<p>变更的商品，是否需要补发物料？</p>
				<el-row>
					<el-radio v-model="Model.replacement" label="0">是</el-radio>
					<el-radio v-model="Model.replacement" label="1">否</el-radio>
				</el-row>
			</el-form>
			<div class="viewDialogFooter">
				<div class="viewDialogFooterSure"  @click="ReplacementAjax(2,'变更成功')">确定</div>
				<div class="viewDialogFooterCancel" @click="Model.Replacementthing = false">取消</div>
			</div>
		</el-dialog>
	</div>
</template>

<script>
	import pathTracking from "@/components/common/pathTracking";
	import pagination from "@/components/common/pagination.vue";
	import advancedSearch from "@/components/common/filter/advancedSearch";
	import {
		getDateString
	} from "@/assets/js/common.js";
	import Model from "./model.js";
	import Controller from "./Controller.js";
	export default {
		name: "purchase",
		mixins: [Model, Controller],
		components: {
			advancedSearch,
			pagination,
			pathTracking
		}
	};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
	@import "./index.less";
</style>
